package com.mar.tech.unify.bean;

import io.vertx.core.Handler;
import io.vertx.core.http.HttpMethod;
import io.vertx.ext.web.RoutingContext;

/**
 * Description: 路由 .<br>
 *
 * @author m-xy
 *     Created By 2019/9/4 11:40
 */
public class ApiHandler {
  private HttpMethod httpMethod;
  private String api;
  private Handler<RoutingContext> handler;
  private boolean auth = false;

  public ApiHandler(HttpMethod httpMethod, String api, Handler<RoutingContext> handler) {
    this.httpMethod = httpMethod;
    this.api = api;
    this.handler = handler;
  }

  public ApiHandler(HttpMethod httpMethod, String api, Handler<RoutingContext> handler, boolean auth) {
    this.httpMethod = httpMethod;
    this.api = api;
    this.handler = handler;
    this.auth = auth;
  }

  public boolean isAuth() {
    return auth;
  }

  public void setAuth(boolean auth) {
    this.auth = auth;
  }

  public HttpMethod getHttpMethod() {
    return httpMethod;
  }

  public void setHttpMethod(HttpMethod httpMethod) {
    this.httpMethod = httpMethod;
  }

  public String getApi() {
    return api;
  }

  public void setApi(String api) {
    this.api = api;
  }

  public Handler<RoutingContext> getHandler() {
    return handler;
  }

  public void setHandler(Handler<RoutingContext> handler) {
    this.handler = handler;
  }
}
